<?php 
namespace app\agent\controller;

use think\Controller;

class Base extends Controller
{
	/**
	 * 
	 * @var unknown
	 */
	public $agent_id;
	
	/**
	 * 
	 * @var unknown
	 */
	public $request;
	
	/**
	 * 
	 * {@inheritDoc}
	 * @see \think\Controller::_initialize()
	 */
	public function _initialize()
	{
		//session('agent_id',1);
		$this->agent_id = session('agent_id');
		$this->request = request();
		//检测登录
		$this->checkLogin();
	}
	
	/**
	 * 检测用户登录
	 */
	private function checkLogin()
	{
		if(!$this->agent_id){
			return $this->redirect(url("login/index"));
		}
	}
}